<?php

/**
 * Trabajo form.
 *
 * @package    laboratorio
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class TrabajoForm extends BaseTrabajoForm
{
  public function configure()
  {
    $this->widgetSchema['fecha_ingreso'] = new sfWidgetFormDateJQueryUI(array("change_month" => true, "change_year" => true, "default_value" => date("Y-m-d")));
    $this->validatorSchema['fecha_ingreso'] = new sfValidatorDate(array('date_format' => '~(?P<day>\d{2})/(?P<month>\d{2})/(?P<year>\d{4})~'));

    $this->widgetSchema['fecha_prueba'] = new sfWidgetFormDateJQueryUI(array("change_month" => true, "change_year" => true, "default_value" => date("d/m/Y", strtotime(date("Y-m-d")."+7 day"))));
    $this->validatorSchema['fecha_prueba'] = new sfValidatorDate(array('date_format' => '~(?P<day>\d{2})/(?P<month>\d{2})/(?P<year>\d{4})~'));

    $this->widgetSchema['fecha_terminado'] = new sfWidgetFormDateJQueryUI(array("change_month" => true, "change_year" => true, "default_value" => date("d/m/Y", strtotime(date("Y-m-d")."+15 day"))));
    $this->validatorSchema['fecha_terminado'] = new sfValidatorDate(array('date_format' => '~(?P<day>\d{2})/(?P<month>\d{2})/(?P<year>\d{4})~'));
    
    $this->widgetSchema['cliente_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cliente'), 'add_empty' => true, 'order_by' => array('apellido', 'asc')), array('data-placeholder' => 'Escriba un Nombre...', 'class' => 'chzn-select', 'style' => 'width:350px;'));
    $this->validatorSchema['cliente_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cliente')));    
  }
  
}
